<?php
/*
 * class imageADP
*/
//require_once('../adp.cls.php');

class imageADP {
	var $mime_type_list = array(
		'image/gif',
		'image/jpeg',
		'image/png',
		'application/x-shockwave-flash',
		'image/psd',
		'image/bmp',
		'image/tiff',
		'image/tiff',
		'application/octet-stream',
		'image/jp2',
		'application/octet-stream',
		'application/octet-stream',
		'application/x-shockwave-flash',
		'image/iff',
		'image/vnd.wap.wbmp',
		'image/xbm',
		'image/vnd.microsoft.icon',
		'image/x-icon'
	);
	
	function adp_init() {
	}
	
	function image_type_to_extension($type, $include_dot = TRUE) {
		$e = array(
			'gif',
			'jpeg',
			'png',
			'swf',
			'psd',
			'bmp',
			'tiff',
			'tiff',
			'jpc',
			'jp2',
			'jpf',
			'jb2',
			'swc',
			'aiff',
			'wbmp',
			'xbm',
			'ico',
			'ico'
			
		);
		if ($type > count($e) - 1) {
			return Exception('file type is not support');
		}
		else {
			return $include_dot ? '.' : '' . $e[$type];
		}
	}
	
	function image_mime_type_to_type($mime_type) {
		return array_search($mime_type, $this->mime_type_list) + 1;
	}
	//function getFileNameFromPath(){
	
	//
	
	//}
	
}
?>